package com.jtx.miaoah2.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jtx.miaoah2.Model.goods.DO.SkGoods;
import com.jtx.miaoah2.Model.goods.DO.SkGoodsSeckill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

/**
 * @author 季台星
 * @Date 2023 07 23 16 52
 */
@Mapper
public interface SkGoodsSeckillMapper extends BaseMapper<SkGoodsSeckill> {
    int updateGoodsStock(@Param("id") Long seckillId);

    int getGoodsVersion(@Param("seckillId") Long seckillId, @Param("goodsId") Long goodsId);

    int incrementGoodsStock(@Param("seckillId") Long seckillId,
                            @Param("goodsId") Long goodsId,
                            @Param("version") int version);


    int incrementGoodsStock1(@Param("seckillId") Long seckillId,
                            @Param("goodsId") Long goodsId);

    int decrementGoodsStock(@Param("seckillId") Long seckillId,
                            @Param("goodsId") Long goodsId,
                            @Param("version") int version);

    int decrementGoodsStock1(@Param("seckillId") Long seckillId,
                            @Param("goodsId") Long goodsId);

}
